package com.feifan.provider.service;

import com.alibaba.dubbo.config.annotation.Service;
import com.feifan.api.model.OmsCompanyAddress;
import com.feifan.api.model.OmsCompanyAddressExample;
import com.feifan.api.service.IOmsCompanyAddressService;
import com.feifan.provider.mapper.OmsCompanyAddressMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @program: FinalProject
 * @author: Xiaofan
 * @createTime: 2021-08-09 08:35
 * @description: Functions of this class is
 **/
@Service(
        version = "1.0.0",
        interfaceName = "com.feifan.api.service.IOmsCompanyAddressService",
        interfaceClass = IOmsCompanyAddressService.class
)
@Transactional
public class OmsCompanyAddressService implements IOmsCompanyAddressService {

    @Autowired
    private OmsCompanyAddressMapper dao;

    @Cacheable(cacheNames = "companyAddressList",unless = "#result==null")
    @Override
    public List<OmsCompanyAddress> list() {
        return dao.selectByExample(new OmsCompanyAddressExample());//返回所有退货的订单
    }
}